package model
{
	import model.vo.MessageVO;
	
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;

	public class MessageProxy extends Proxy implements IProxy
	{
		public static const NAME:String				= "MessagesProxy";
		
		public function MessageProxy()
		{
			super( NAME , new MessageVO() );
		}
		
		public function setMessages( obj:Object ):void
		{
			var arr:Array = obj.userValidationError.split("||");

			vo.userValidationError.info 			= arr[0];
			vo.userValidationError.infoDetail		= arr[1];
		}
		
		public function userValidationError():Object
		{
			return vo.userValidationError;
		}
		
		public function get vo():MessageVO
		{
			return data as MessageVO;
		}
		
		private function get viewProxy():ViewProxy
		{
			return facade.retrieveProxy( ViewProxy.NAME ) as ViewProxy;
		}
	}
}